#ifndef CCUBETREE_H
#define CCUBETREE_H

#include "component.h"
#include "sync.h"
#include "Vector.h"

#include <GL/gl.h>

class cCubeTree : public Component {
public:
	cCubeTree(Sync* sync);
	virtual ~cCubeTree();

	void initialize();
	void draw(float time, float dt, float alpha);

private:
	typedef struct {
		Vector position;
		float timeStart;
		float speed;
	} Worm;

	Worm* worm;
	int worm_count;

	GLuint cubeVertices;
	GLuint cubePolygon;
	GLuint cubeEdges;

	void initWorm(int n, float time);
};

#endif /* CCUBETREE_H */
